const { find } = require('./car')

const Shopcarlist = require('../../db').Shopcarlist

module.exports = {
    async find(ctx,next){
        let ids = ctx.params.ids
        ids = ids.split(',')
        let idsArr = []
        ids.forEach(item => {
           idsArr.push({ "id": item }) 
        })
        console.log(idsArr)

        try{
            let listinfo = await Shopcarlist.find({"$or": idsArr},null)

            ctx.body = {
                code: 200,
                msg: '获取信息成功',
                list: listinfo
            }
        } catch(e){
            ctx.body = {
                code: 500,
                msg: '获取信息失败'
            }
        }
    }
}